\subsubsection{Phase2: Clerify  Regions}
\paragraph{Purpose}

After identifying regions, it is necessary to clarify these regions.  The majority of this step involves  determining where the code should live.  That is to say, computation will happen on the device, but some might be on the host.  The variables will exist either on the host or the device or both.  In the preprocessor directives, we exchange MPI library calls for our CUDA library calls.  There will also be a reorganization of the declaration/initialization to make the code less ambiguous.

\paragraph {Output}
Output will be code that is grouped into sections and each section is identified with comments that make it ready to separate into host vs device code.

\paragraph{Meta Algoritm}


\begin{description}
\item [Step 1]Clarify preprocessor region.  
 Identify lines to keep and lines to change, and mark them with '//keep' or '//change'  Keep the standard C headers and change the MPI headers.

\item [Step 2] Clarify declarations/initializations

\item [Step 3] Clarify MPI Initialization region.

\item [Step 4]  Clarify Computation regions.

\end{description}




\paragraph{Sample Code}


\input{tabs/tab-algorithm_phase2}



\begin{cudablock}
///// Preproc Begin
#include <stdio>
#include <mpi.h>
///// Preproc End
\end{cudablock} 

\begin{cudablock}
///// Preproc Begin
#include <stdio>  /// Keep
#include <mpi.h> /// Change
///// Preproc End
\end{cudablock} 

